/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package frmwrk.core;

import frmwrk.interfaces.IParty;
import java.util.HashMap;
import java.util.List;
import java.util.Observer;

/**
 *
 * @author kgergis
 */
public class AccountFactory {

    public Account create(HashMap<String, String> params, IParty party, List<Observer> observers) {

        int accountNumber = Integer.parseInt(params.get("accountNumber"));
        Double balance = Double.valueOf(params.get("balance"));
        Account ret = new Account(accountNumber, balance);
        ret.setParty(party);
        for(Observer observer : observers)
            ret.addObserver(observer);
        return ret;
    
    }
}
